<%--
  Created by IntelliJ IDEA.
  User: libing
  Date: 2016/7/23
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid" %>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <rapid:override name="head">
        <meta charset="UTF-8">
        <title>resumes</title>
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.1.10.1.min.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/common.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath }/js/libs/modernizr.min.js"></script>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/font-awesome/bootstrap/bootstrap.css"/>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/font-awesome/css/font-awesome.css"/>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/common.css"/>
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/main.css"/>
        <%--        <style type="text/css">
                    .sidebar-wrap{float: left;width: 20%;min-height:900px;background: #f2f2f2;border-right:1px solid #ccc;/*cursor:e-resize;*/}
                </style>--%>
    </rapid:override>
    <script type="text/javascript">
        function noneRead() {
            window.location.href = "${pageContext.request.contextPath }/admin/returnResumesInfo.action?status=0";
        }
        function haveRead() {

        }
        function nonePass() {

        }
        function commonJs(status,page){
            $.ajax({
                type:'get',
                url:'${pageContext.request.contextPath }/admin/requestJson.action',
                contentType:'application/json;charset=utf-8',
                dataType:'json',
                data:'status='+status+'&page='+page,
                success:function (data) {
                    if(data == "{}")
                    {
                        alert("没有数据了");
                    }else {
                        $('#content').empty();//清空content里面的内容
                        var html;
                        var mystatus="";
                        $.each(data,function (i,item) {
                            html += "<tr>";
                            html += "<td>"+item.resumeId+"</td>";
                            html += "<td>"+item.serialNum+"</td>";
                            html += "<td>"+item.customer.fullName+"</td>";
                            if (item.status == 2)
                                    mystatus = "未通过";
                            else if(item.status == 1)
                                    mystatus = "已审阅";
                            else
                                    mystatus = "未审阅";
                            html += "<td>"+mystatus+"</td>";
                            html += "<td>"+item.dateAdded+"</td>";
                            html += "<td>";
                            html += "<a href='${pageContext.request.contextPath }/admin/selectResumeById.action?resumeId="+item.resumeId+"'><i class='icon-pencil'></i></a>";
                            html += "<a href='#myModal' role='button' data-toggle='modal'><i class='icon-remove'></i></a>";
                            html += "</td>";
                            html += "</tr>";
                            html += "<div class='pagination'>";
                            html += "<ul>";
                            html += "<li><a href='#' onclick='commonJs(item.status,1)'>Prev</a></li>";
                            html += "<li><a href='#'>2</a></li>";
                            html += "<li><a href='#' onclick='commonJs(item.status,3)'>Next</a></li>";
                            html += "</ul>";
                            html += "</div>";

                        });
                        $('#content').html(html);
                    }
                },
                error:function () {
                   alert("error");
                }
            });
        }
    </script>
</head>
<body>
<%--<rapid:override name="top">
这里如果不想改变父页面的内容的话，就不要写出来了，否则会认为你重写了父页面的这个top
</rapid:override>--%>
<div class="container clearfix">

    <rapid:override name="main_wrap">

        <div class="span9">
            <h1 class="page-title">Resumes</h1>
            <div class="btn-toolbar">
                <button class="btn btn-primary btn_already" onclick="commonJs(0,1)"><i class="icon-plus"></i>未审阅</button>
                <button class="btn btn_noneRead" onclick="commonJs(1,1)"><i class="icon-plus"></i>已审阅</button>
                <button class="btn btn_noPass" onclick="commonJs(2,1)"><i class="icon-plus"></i>未通过</button>
                <div class="btn-group">
                </div>
            </div>
            <div class="well" id="well">
                <table class="table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>简历名称</th>
                        <th>所属者</th>
                        <th>状态</th>
                        <th>时间</th>
                        <th>opt</th>
                    </tr>
                    </thead>
                    <tbody id="content">
                        <c:forEach items="${list}" var="lists">
                            <tr>
                                <td>${lists.resumeId}</td>
                                <td>${lists.serialNum}</td>
                                <td>${lists.customer.fullName}</td>
                                <td><c:choose><c:when test="${lists.status == 2}">未通过</c:when><c:when test="${lists.status == 1}">已审阅</c:when><c:otherwise>未审阅</c:otherwise></c:choose></td>
                                <td>${lists.dateAdded}</td>
                                <td>
                                    <a href="${pageContext.request.contextPath }/admin/selectResumeById.action?resumeId=${lists.resumeId}"><i class="icon-pencil"></i></a>
                                    <a href="#myModal" role="button" data-toggle="modal" onclick=""><i class="icon-remove"></i></a>
                                </td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
                <div class="pagination">
                    <ul>
                        <li><a href="#" onclick="commonJs(0,1)">Prev</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#" onclick="commonJs(0,3)">Next</a></li>
                    </ul>
                </div>
            </div>

            <div class="modal small hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h3 id="myModalLabel">Delete Confirmation</h3>
                </div>
                <div class="modal-body">
                    <p class="error-text"><i class="icon-warning-sign modal-icon"></i>Are you sure you want to delete the user?</p>
                </div>
                <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
                    <button class="btn btn-danger" data-dismiss="modal" onclick="">Delete</button>
                </div>
            </div>

        </div>

    </rapid:override>

</div>

</body>
</html>
<%@include file="../common/templateJSP.jsp"%>